package com.example.myapplication.ui.activity.login

import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import com.example.myapplication.request.LoginRequest
import kotlinx.coroutines.launch

/**
 *注册的viewModel
 *
 * @author : Kun
 * @date : 2021/6/4
 * @time : 14:13
 */
class RegisterViewModel : ViewModel() {
    /**
     * 登录相关的request
     */
    val loginRequest = LoginRequest()

    /**
     * 注册
     */
    fun requestRegister(userName: String, password: String, rePassword: String) {
        viewModelScope.launch {
            loginRequest.requestRegister(userName, password, rePassword)
        }
    }
}